<?php

use yii\helpers\Html;
use yii\bootstrap\ActiveForm;
use common\widgets\webuploader\Webuploader;
use common\widgets\webuploader\UploadType;

/* @var $this yii\web\View */
/* @var $model common\models\ArticleTest */
/* @var $form yii\bootstrap\ActiveForm */
?>

<div class="article-test-form">

    <?php $form = ActiveForm::begin(); ?>

    <?php echo $form->errorSummary($model); ?>

    <?php echo $form->field($model, 'title')->textInput(['maxlength' => true]) ?>
	
    <?php echo $form->field($model, 'content')->textarea(['rows' => 6]) ?>

	<?php echo $form->field($model,'thum_addr')->widget(Webuploader::className() ,['type' => UploadType::SINGLE_IMG,'width'=>200,'height'=>200]); ?>
	
    <?php echo $form->field($model,'img_list_addr')->widget(Webuploader::className() ,['type' => UploadType::MULTI_IMG]); ?>

    <?php echo $form->field($model,'file_addr')->widget(Webuploader::className() ,['type' => UploadType::SINGLE_FILE]); ?>
	
	<?php 
    //echo $form->field($model,'file_list_addr')->widget(Webuploader::className() ,['type' => UploadType::MULTI_FILE]); 
	//多文件上传就不适用activeform方式了，使用普通表单方式进行演示
	//该多图例子使用Webuploader Widget方式来替代演示↙↙↙↙↙↙↙↙↙↙↙↙↙↙
    ?>
    <div class="form-group">
    	<label class="control-label">多文件</label>
    	<?= Webuploader::widget(['name' => 'file_list_addr','value'=>$model->file_list_addr,'type' => UploadType::MULTI_FILE])?>
    </div>
	
    <div class="form-group">
    	<?php echo getReferUrlBtn(); ?>
        <?php echo Html::submitButton($model->isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
    </div>

    <?php ActiveForm::end(); ?>

</div>
